package com.geely.design.pattern.behavioral.responsibilitychain;

import org.springframework.util.StringUtils;

public class ArticleApprover extends Approver {

    public ArticleApprover(Approver approver) {
        super(approver);
    }

    @Override
    public void deploy(Course course) {
        if (!StringUtils.isEmpty(course.getArticle())) {
            System.out.println("article有内容,允许通过!当前节点处理完毕,交给下一节点处理");
            if (super.nextApprover != null) { // 交给下一节点处理
                super.nextApprover.deploy(course);
            }
        } else {
            System.out.println("article无内容,不通过,流程到此结束");
        }
    }


}
